home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- GNUStaticPane.c
-
- A superclass of CAbstractText, with functionality similar to CEditPane in static
- text mode, but does
- not make use of textedit, so can handle arbitrary size buffers.
-
- Body of Draw, CalcLineStarts, IndexToLine methods
- Incorporate code originally written by
- Roy Wood 122 Britannia Avenue London, Ontario, Canada N6H 2J5
-
- Brazenly hacked for TCL compatibility by Jonathan Kimmitt.
-
- The many bugs introduced during this process are entirely my fault
-
- */
-
-
- #pragma once
-
- #include "CAbstractText.h" /* Interface for its superclass */
-
- class GNUStaticPane : public CAbstractText { /* Class Declaration */
-
- public:
- /** Instance Variables **/
- long spacingCmd; /* Line spacing command number */
- long alignCmd; /* alignment cmd number */
-
- /** Instance Methods **/
- /** Contruction/Destruction **/
- virtual void IGNUStaticPane(CView *anEnclosure, CBureaucrat *aSupervisor);
- virtual void Dispose(void);
-
- virtual void Draw(Rect *area);
-
- virtual void Scroll( long hDelta, long vDelta, Boolean redraw);
-
- virtual void GetSteps(short *hStep, short *vStep); // TCL 1.1.3 11/30/92 BF
-
- /** Text Specification **/
- virtual void SetTextPtr(Ptr textPtr, long numChars);
- virtual Handle GetTextHandle(void);
-
- virtual void ResizeFrame(Rect *delta);
- virtual void AdjustBounds(void);
-
- virtual long FindLine( long charPos);
- virtual long GetLength( void);
-
- /** Text Characteristics **/
- virtual void SetFontNumber(short aFontNumber);
- virtual void SetFontStyle(short aStyle);
- virtual void SetFontSize(short aSize);
- virtual void SetTextMode(short aMode);
-
- virtual void SetSpacingCmd( long aSpacingCmd);
- virtual void GetGNUTEFontInfo(FontInfo *macFontInfo);
- virtual void GetTextStyle( short *whichAttributes, TextStyle *aStyle);
- virtual void GetCharStyle( long charOffset, TextStyle *theStyle);
- virtual long GetSpacingCmd( void);
- virtual long GetAlignCmd( void);
- /** Printing **/
- virtual void PrintPage(short pageNum, short pageWidth, short pageHeight, CPrinter *aPRinter);
-
- virtual void GetExtent(long *theHExtent,long *theVExtent);
- virtual long GetHeight(long startLine, long endLine);
- virtual void GetSelection(long *selStart, long *selEnd);
- virtual long GetCharOffset( LongPt *aPt);
- virtual void GetCharPoint( long offset, LongPt *aPt);
- virtual void TypeChar(char theChar, short theModifers);
- virtual void SetSelection( long selStart, long selEnd, Boolean fRedraw);
- virtual Handle CopyTextRange( long start, long end);
- virtual void PerformEditCommand( long theCommand);
- virtual void InsertTextPtr( Ptr text, long length, Boolean fRedraw);
-
-
- private:
-
- virtual void SetFontStuff(void);
- virtual void CalcLineStarts(void);
- virtual long indexToLine(long selIndex);
-
- LongPt frame_origin;
- short lineHeight;
- short fontAscent;
- long teLength;
- Handle hText;
- short txFont;
- char txFace;
- short txMode;
- short txSize;
- short tabWidth;
- long nLines;
- short theCharWidths[256];
- long **lineStarts;
- };
-